SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author:		Emanuel Santos
-- Create date: 23-01-2013
-- Description:	Actualizar evento
-- =============================================
CREATE PROCEDURE [ext].[sp_fe_editEvento]
	-- Add the parameters for the stored procedure here
	@id_e int, 
	@id_c int,
	@data_i date,
	@data_f date,
	@titulo varchar(50),
	@descricao varchar(50),
	@preco money,
	@morada varchar(50),
	@codigo_postal varchar(9),
	@url varchar(50),
	@tlf varchar(50),
	@email varchar(50),
	@latitude varchar(20),
	@longitude varchar(20)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	UPDATE [extremeEvents].[ext].[evento]
	   SET [id_categoria] = @id_c
		  ,[data_inicio] = @data_i
		  ,[data_fim] = @data_f
		  ,[titulo] = @titulo
		  ,[descricao] = @descricao
		  ,[preco] = @preco
		  ,[morada] = @morada
		  ,[codigo_postal] = @codigo_postal
		  ,[url] = @url
		  ,[contato_telefonico] = @tlf
		  ,[email] = @email
		  ,[latitude] = @latitude
		  ,[longitude] = @longitude
	 WHERE id_evento = @id_e;
END
GO
